package com.alibaba.citrus.ots.unified.inventory.repository;

import com.epoch.app.otsunifiedinventory.dto.request.*;
import com.epoch.app.otsunifiedinventory.dto.response.*;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderCancelDeliveredRequest;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderCancelDeliveredResponse;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderCancelReceivedRequest;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderCancelReceivedResponse;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderCancelRequest;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderCancelShippedRequest;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderCancelShippedResponse;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderCreateRequest;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderDeliveryRequest;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderReturnOrderRequest;
import com.epoch.app.otsunifiedinventory.model.dto.AllocateOrderReturnOrderResponse;
import com.epoch.app.otsunifiedinventory.sdo.AllocateOrderDetailSDO;
import com.epoch.app.otsunifiedinventory.sdo.AllocateOrderSDO;

import java.util.List;

/**
 * @description:
 * @author: yuhw
 * @date: 2021年09月17日 10:57
 **/
public interface AllocateOrderWriteRepository {
    String create(AllocateOrderSDO allocateOrderSDO);

    String create(AllocateOrderCreateRequest request);

    String save(AllocateOrderSDO allocateOrderSDO);

    List<String> save(List<AllocateOrderDetailSDO> detailSDOS);

    String sync(AllocateOrderSDO allocateOrderSDO);

    String sync(AllocateOrderSDO allocateOrderSDO, List<AllocateOrderDetailSDO> detailSDOS);


    String salesOrderSync(AllocateOrderSalesOrderSyncRequest request);

    AllocateOrderResponse manualCreate(AllocateOrderManualCreateRequest request);

    String save(AllocateOrderSaveRequest request);

    String submit(AllocateOrderSubmitRequest allocateOrderSubmitRequest);

    AllocateOrderGetCustomerResponse getCustomer(String code);


    AllocateOrderSyncResponse passiveSync(AllocateOrderSyncRequest allocateOrderSyncRequest);


    AllocateOrderShippedResponse shipped(AllocateOrderShippedRequest request);

    AllocateOrderReceivedResponse received(AllocateOrderReceivedRequest request);


    /**
     * 退单
     * @param request
     * @return
     */
    AllocateOrderReturnOrderResponse returnOrder(AllocateOrderReturnOrderRequest request);

    /**
     * 交货
     * @param allocateOrderDeliveryRequest
     * @return
     */
    AllocateOrderDeliveryResponse delivered(AllocateOrderDeliveryRequest allocateOrderDeliveryRequest);

    AllocateOrderCancelDeliveredResponse cancelDelivered(AllocateOrderCancelDeliveredRequest allocateOrderCancelDeliveredRequest);

    /**
     * 取消
     * @param allocateOrderCancelRequest
     * @return
     */
    AllocateOrderCancelResponse cancel(AllocateOrderCancelRequest allocateOrderCancelRequest);


    /**
     * 回调
     * @param allocateOrderNotifyRequest
     * @return
     */
    AllocateOrderNotifyResponse notify(AllocateOrderNotifyRequest allocateOrderNotifyRequest);

    //撤销发货
    AllocateOrderCancelShippedResponse cancelShipped(AllocateOrderCancelShippedRequest request);

    //撤销收货
    AllocateOrderCancelReceivedResponse cancelReceived(AllocateOrderCancelReceivedRequest request);

    boolean updata(AllocateOrderSDO allocateOrderSDO);
    //修正下调拨单和明细的状态
    boolean fixStatus(String outAllocateOrderId);
    //修正下调拨单明细的交货数量
    boolean fixDeliveryQuantity(String outAllocateOrderId);
}
